import { defineStore } from 'pinia'
import uniStorage from '@/utils/storage'
import type { SkuProduct, Category } from '@/types'
export const useCateStore = defineStore('category', {
  state: () => ({
    cateList: [] as Category[],
    skuProductList: [] as SkuProduct[],
  }),
  actions: {
    setCateList(list: Category[]) {
      this.cateList = list
    },
    setSkuProductList(list: SkuProduct[]) {
      this.skuProductList = list
    },
  },
  persist: {
    enabled: true,
    strategies: [
      {
        storage: uniStorage,
      },
    ],
  },
})
